home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / GSER.DEM < prev    next >
Text File  |  1991-04-29  |  681b  |  29 lines

  1. PROGRAM d6r8(input,output,dfile);
  2. (* driver for routine GSER *)
  3. VAR
  4.    a,gamser,gln,val,x : real;
  5.    i,nval : integer;
  6.    txt : string[25];
  7.    dfile : text;
  8.  
  9. (*$I MODFILE.PAS *)
  10. (*$I GAMMLN.PAS *)
  11.  
  12. (*$I GSER.PAS *)
  13.  
  14. BEGIN
  15.    glopen(dfile,'fncval.dat');
  16.    REPEAT readln(dfile,txt) UNTIL (txt = 'Incomplete Gamma Function');
  17.    readln(dfile,nval);
  18.    writeln(txt);
  19.    writeln('a':4,'x':11,'actual':14,'gser(a,x)':14,
  20.          'gammln(a)':12,'gln':8);
  21.    FOR i := 1 to nval DO BEGIN
  22.       readln(dfile,a,x,val);
  23.       gser(a,x,gamser,gln);
  24.       writeln(a:6:2,x:12:6,val:12:6,gamser:12:6,
  25.             gammln(a):12:6,gln:12:6)
  26.    END;
  27.    close(dfile)
  28. END.
  29.